package com.sicaolong.process;

import com.sicaolong.eventdefine.model.EventProcess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

public abstract class AbstractAdEventProcess implements EventProcess {

    private static final Logger logger = LoggerFactory.getLogger(AbstractAdEventProcess.class);

    private void before() {
        logger.warn("進入了事件---" + new Date());
    }

    protected abstract void doHandle();

    private void after() {
        logger.warn("完成了事件---" + new Date());
    }

    @Override
    public void handle() {
        before();
        doHandle();
        after();
    }
}
